<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <rich:panel>
        <f:facet name="header">Game</f:facet>



        <s:decorate id="crossLane" template="layout/display.xhtml">
            <ui:define name="label">crossLane</ui:define>
            #{gameHome.instance.crossLane}
        </s:decorate>


        <s:decorate id="date" template="layout/display.xhtml">
            <ui:define name="label">date</ui:define>
            <h:outputText value="#{gameHome.instance.date}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>


        <s:decorate id="frameDetails" template="layout/display.xhtml">
            <ui:define name="label">frameDetails</ui:define>
            #{gameHome.instance.frameDetails}
        </s:decorate>


        <s:decorate id="gameDetailLevel" template="layout/display.xhtml">
            <ui:define name="label">gameDetailLevel</ui:define>
            #{gameHome.instance.gameDetailLevel}
        </s:decorate>


        <s:decorate id="lane" template="layout/display.xhtml">
            <ui:define name="label">lane</ui:define>
            #{gameHome.instance.lane}
        </s:decorate>


        <s:decorate id="pinDetails" template="layout/display.xhtml">
            <ui:define name="label">pinDetails</ui:define>
            #{gameHome.instance.pinDetails}
        </s:decorate>


        <s:decorate id="result" template="layout/display.xhtml">
            <ui:define name="label">result</ui:define>
            #{gameHome.instance.result}
        </s:decorate>

        <div style="clear:both"/>
        
    </rich:panel>
    
    <div class="actionButtons">      

        <s:button view="/GameEdit.xhtml" 
                    id="edit" 
                 value="Edit"/>

        <s:button view="/#{empty gameFrom ? 'GameList' : gameFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab label="alley">
    <div class="association" id="alleyParent">
        
        <h:outputText value="There is no alley associated with this game." 
                   rendered="#{gameHome.instance.alley == null}"/>
        
        <rich:dataTable var="alley" 
                   value="#{gameHome.instance.alley}" 
                rendered="#{gameHome.instance.alley != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="alleyTable">
            <h:column>
                <f:facet name="header">id</f:facet>
                #{alley.id}
            </h:column>
            <h:column>
                <f:facet name="header">description</f:facet>
                #{alley.description}
            </h:column>
            <h:column>
                <f:facet name="header">name</f:facet>
                #{alley.name}
            </h:column>
            <h:column>
                <f:facet name="header">numberOfLanes</f:facet>
                #{alley.numberOfLanes}
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link id="viewalley" 
                     value="View" 
                      view="/Alley.xhtml">
                    <f:param name="alleyId" 
                           value="#{alley.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    </rich:tab>

    <rich:tab label="gameBlock">
    <div class="association" id="gameBlockParent">
        
        <h:outputText value="There is no gameBlock associated with this game." 
                   rendered="#{gameHome.instance.gameBlock == null}"/>
        
        <rich:dataTable var="gameBlock" 
                   value="#{gameHome.instance.gameBlock}" 
                rendered="#{gameHome.instance.gameBlock != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="gameBlockTable">
            <h:column>
                <f:facet name="header">id</f:facet>
                #{gameBlock.id}
            </h:column>
            <h:column>
                <f:facet name="header">average</f:facet>
                #{gameBlock.average}
            </h:column>
            <h:column>
                <f:facet name="header">description</f:facet>
                #{gameBlock.description}
            </h:column>
            <h:column>
                <f:facet name="header">onePinSparePercentage</f:facet>
                #{gameBlock.onePinSparePercentage}
            </h:column>
            <h:column>
                <f:facet name="header">sparePercentage</f:facet>
                #{gameBlock.sparePercentage}
            </h:column>
            <h:column>
                <f:facet name="header">strikePercentage</f:facet>
                #{gameBlock.strikePercentage}
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link id="viewgameBlock" 
                     value="View" 
                      view="/GameBlock.xhtml">
                    <f:param name="gameBlockId" 
                           value="#{gameBlock.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    </rich:tab>

    <rich:tab label="gameSet">
    <div class="association" id="gameSetParent">
        
        <h:outputText value="There is no gameSet associated with this game." 
                   rendered="#{gameHome.instance.gameSet == null}"/>
        
        <rich:dataTable var="gameSet" 
                   value="#{gameHome.instance.gameSet}" 
                rendered="#{gameHome.instance.gameSet != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="gameSetTable">
            <h:column>
                <f:facet name="header">id</f:facet>
                #{gameSet.id}
            </h:column>
            <h:column>
                <f:facet name="header">average</f:facet>
                #{gameSet.average}
            </h:column>
            <h:column>
                <f:facet name="header">description</f:facet>
                #{gameSet.description}
            </h:column>
            <h:column>
                <f:facet name="header">onePinSparePercentage</f:facet>
                #{gameSet.onePinSparePercentage}
            </h:column>
            <h:column>
                <f:facet name="header">sparePercentage</f:facet>
                #{gameSet.sparePercentage}
            </h:column>
            <h:column>
                <f:facet name="header">strikePercentage</f:facet>
                #{gameSet.strikePercentage}
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link id="viewgameSet" 
                     value="View" 
                      view="/GameSet.xhtml">
                    <f:param name="gameSetId" 
                           value="#{gameSet.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    </rich:tab>

    <rich:tab label="player">
    <div class="association" id="playerParent">
        
        <h:outputText value="There is no player associated with this game." 
                   rendered="#{gameHome.instance.player == null}"/>
        
        <rich:dataTable var="player" 
                   value="#{gameHome.instance.player}" 
                rendered="#{gameHome.instance.player != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="playerTable">
            <h:column>
                <f:facet name="header">id</f:facet>
                #{player.id}
            </h:column>
            <h:column>
                <f:facet name="header">cbaId</f:facet>
                #{player.cbaId}
            </h:column>
            <h:column>
                <f:facet name="header">name</f:facet>
                #{player.name}
            </h:column>
            <h:column>
                <f:facet name="header">action</f:facet>
                <s:link id="viewplayer" 
                     value="View" 
                      view="/Player.xhtml">
                    <f:param name="playerId" 
                           value="#{player.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>
        
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
